<template>
  <div>
    <a-card>
      <a-form :form="form">
        <a-row>
          <a-col :md="24" :sm="24">
            <a-col :md="12" :sm="24">
              <a-form-item
                label="门类"
                :labelCol="{span: 7,offset: 1}"
                :wrapperCol="{span: 15, offset: 1}"
              >
                <a-select v-decorator="['ml',
                  {
                    rules: [{ required: true, message: '请选择门类' }],
                  }]">
                  <a-select-option v-for="i in TYPE0126" :key="i.id" :value="i.dwh">{{ i.dwmc }}</a-select-option>
                </a-select>
              </a-form-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-item
                label="学科专业码"
                :labelCol="{span: 7,offset: 1}"
                :wrapperCol="{span: 15, offset: 1}"
              >
                <a-input placeholder="请选择门类" disabled/>
              </a-form-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-item
                label="招生年度"
                :labelCol="{span: 7,offset: 1}"
                :wrapperCol="{span: 15, offset: 1}"
              >
                <a-select v-decorator="['zsnd',
                  {
                    rules: [{ required: true, message: '招生年度' }],
                  }]">
                  <a-select-option v-for="i in TYPE0126" :key="i.id" :value="i.dwh">{{ i.dwmc }}</a-select-option>
                </a-select>
              </a-form-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-item
                label="外语听力"
                :labelCol="{span: 7,offset: 1}"
                :wrapperCol="{span: 15, offset: 1}"
              >
                <a-input v-decorator="[
                  'wytl',
                  {
                    rules: [{ required: true, message: '请输入外语听力!' }],
                  }
                ]"/>
              </a-form-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-item
                label="外语笔试"
                :labelCol="{span: 7,offset: 1}"
                :wrapperCol="{span: 15, offset: 1}"
              >
                <a-input v-decorator="[
                  'wybs',
                  {
                    rules: [{ required: true, message: '请输入外语笔试!' }],
                  }
                ]"/>
              </a-form-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-item
                label="外语口语"
                :labelCol="{span: 7,offset: 1}"
                :wrapperCol="{span: 15, offset: 1}"
              >
                <a-input v-decorator="[
                  'wyky',
                  {
                    rules: [{ required: true, message: '请输入外语口语!' }],
                  }
                ]"/>
              </a-form-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-item
                label="外语总分"
                :labelCol="{span: 7,offset: 1}"
                :wrapperCol="{span: 15, offset: 1}"
              >
                <a-input v-decorator="[
                  'wyzf',
                  {
                    rules: [{ required: true, message: '请输入外语总分!' }],
                  }
                ]"/>
              </a-form-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-item
                label="业务课一"
                :labelCol="{span: 7,offset: 1}"
                :wrapperCol="{span: 15, offset: 1}"
              >
                <a-input v-decorator="[
                  'ywky',
                  {
                    rules: [{ required: true, message: '请输入业务课一!' }],
                  }
                ]"/>
              </a-form-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-item
                label="业务课二"
                :labelCol="{span: 7,offset: 1}"
                :wrapperCol="{span: 15, offset: 1}"
              >
                <a-input v-decorator="[
                  'ywke',
                  {
                    rules: [{ required: true, message: '请输入业务课二!' }],
                  }
                ]"/>
              </a-form-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-item
                label="业务课三"
                :labelCol="{span: 7,offset: 1}"
                :wrapperCol="{span: 15, offset: 1}"
              >
                <a-input v-decorator="[
                  'ywks',
                  {
                    rules: [{ required: true, message: '请输入业务课三!' }],
                  }
                ]"/>
              </a-form-item>
            </a-col>
            <a-col :md="12" :sm="24">
              <a-form-item
                label="总成绩"
                :labelCol="{span: 7,offset: 1}"
                :wrapperCol="{span: 15, offset: 1}"
              >
                <a-input v-decorator="[
                  'zcj',
                  {
                    rules: [{ required: true, message: '请输入总成绩!' }],
                  }
                ]"/>
              </a-form-item>
            </a-col>
          </a-col>
        </a-row>
      </a-form>
    </a-card>

    <div class="ant-pro-footer-toolbar">
      <a-button style="float: right;margin-top: 10px;" @click="handleSubmit" :loading="loadingBtn" type="primary">保存</a-button>
    </div>
  </div>
</template>
<script>
import { mapState } from 'vuex'
const selectArr = ['TYPE0320', 'TYPE0321', 'TYPE0011', 'TYPE0360', 'TYPE0342', 'TYPE0018', 'TYPE0023', 'TYPE0126']

export default {
  data () {
    return {
      selectMenu: {},
      loading: false,
      imageUrl: '',
      loadingBtn: false
    }
  },
  beforeCreate () {
    this.form = this.$form.createForm(this)
  },
  computed: {
    ...mapState({
      TYPE0126: state => state.app['TYPE0126']
    })
  },
  created () {
    selectArr.forEach(v => {
      this.$store.dispatch('app/setDictionary', v)
    })
    this.initSelectMenu()
  },
  methods: {
    initSelectMenu () {
      let allRequest = [
        this.$api.base.collegeAll(),
        this.$api.base.areaList()
      ]
      Promise.all(allRequest).then(res => {
        this.selectMenu = {
          yx: res[0].data
        }
      })
    },
    handleSearch () {
    },
    handleSubmit () {
      this.form.validateFields((err, values) => {
        if (err) {
        }
      })
    }
  }
}
</script>
